﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using Auction_Intranet.Helpers;

namespace Auction_Intranet.Models
{
    public class EditRoomModel
    {      
        public int id { get; set; }

        [Display(Name = "Room name")]
        [Required(ErrorMessage="Field required")]
        public string name { get; set; }

        [Display(Name = "Location")]
        [Required(ErrorMessage = "Field required")]
        public string location { get; set; }

        [Display(Name = "Capacity")]
        [Required(ErrorMessage = "Field required")]
        [RegularExpression("([1-8])", ErrorMessage = "Capacity values must be in range 1-8")]
        public int capacity { get; set; }

        [Display(Name = "Size(square meters)")]
        [Required(ErrorMessage = "Field required")]
        //[RegularExpression("([1-9][0-9]*.[0-9][0-9]*)", ErrorMessage = "Positive number required")]
        [Range(1, Double.MaxValue, ErrorMessage = "Positive number required")]       
        public decimal size { get; set; }

        //public IList<Amenity> amenities { get; set; }
        public List<AmenityModel> amenities { get; set; }

        public string[] myAmenities { get; set; }

        [Display(Name = "Picture 1")]
        [FileExtensions("png|jpg|jpeg|gif|JPG", ErrorMessage = "Invalid file extension")]
        public HttpPostedFileWrapper ImageUploaded1 { get; set; }

        [Display(Name = "Picture 2")]
        [FileExtensions("png|jpg|jpeg|gif|JPG", ErrorMessage = "Invalid file extension")]
        public HttpPostedFileWrapper ImageUploaded2 { get; set; }

        [Display(Name = "Picture 3")]
        [FileExtensions("png|jpg|jpeg|gif|JPG", ErrorMessage="Invalid file extension")]
        public HttpPostedFileWrapper ImageUploaded3 { get; set; }

        [Display(Name = "Picture 4")]        
        [FileExtensions("png|jpg|jpeg|gif|JPG", ErrorMessage = "Invalid file extension")]
        public HttpPostedFileWrapper ImageUploaded4 { get; set; }
    }
}